class Person{
    public void test(){
        System.out.println("Person::test()");
    }
}
public class TestDemo4 {

    public static void main(String[] args) {
        //new Person();

        new Person(){
            @Override
            public void test(){
                System.out.println("cool");
            }
        }.test();
    }

    public static void func(int[] array) {

    }

    public static void func2(Person person) {

    }

    public static void main2(String[] args) {
        Person person = new Person();
        person.test();
        person.test();

        new Person();//匿名对象   只能使用一次
        new Person();

        func2(new Person());
    }

    public static void main1(String[] args) {
        int[] array = new int[]{1,2,3};
        func(array);

        func(new int[]{1,2,3});//匿名数组对象

    }
}